<!--
 * @Author: ylyu
 * @Date: 2024-02-24 09:40:16
 * @LastEditors: ylyu
 * @LastEditTime: 2024-02-24 09:52:12
 * @Description: 
-->
<template>
  <div class="modal-wrapper">
    <a-modal
      v-model:visible="visible"
      @ok="handleOk"
      @cancel="handleCancel"
      :title="title"
      :width="width"
      :simple="simple"
    >
      <p style="text-align: center">{{ desc }}</p>
      <slot name="footer"></slot>
    </a-modal>
  </div>
</template>

<script>
export default {
  name: 'DModal',
  props: [
    {
      visible: {
        type: Boolean,
        default: false,
      },
    },
    {
      simple: {
        type: Boolean,
        default: false,
      },
    },
    {
      title: {
        type: String,
        default: '提示',
      },
    },
    {
      desc: {
        type: String,
        default: '',
      },
    },
    {
      width: {
        type: Number,
        default: 280,
      },
    },
  ],
  data() {
    return {
      // visible: false,
    }
  },
  methods: {
    handleOk() {
      this.$emit('ok')
    },
    handleCancel() {
      this.$emit('cancel')
    },
  },
}
</script>

<style scoped lang="less">
div {
  width: 100%;
}
</style>
